<!doctype html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="admin/public/head::head(~{::title},~{},~{})">
    <title>主页-答题吧后台管理系统</title>
</head>
<body>

<!-- 顶部开始 -->
<div class="container" th:fragment="top-menu">
    <div class="logo">
        <a href="/admin/index/index">DTBAdmin v1.0</a>
    </div>
    <div class="left_open">
        <i title="展开左侧栏" class="iconfont">&#xe699;</i>
    </div>
    <ul class="layui-nav left fast-add" th:if="${session.admin.adminType}==0">
        <li class="layui-nav-item">
            <a href="javascript:;">+新增</a>
            <dl class="layui-nav-child">
                <!-- 二级菜单 -->
                <dd>
                    <a onclick="WeAdminShow('管理员','/admin/admin/addPage')"><i class="iconfont">&#xe6b8;</i>管理员</a>
                </dd>
            </dl>
        </li>
    </ul>
    <ul class="layui-nav right" lay-filter="">
        <li class="layui-nav-item">
            <a href="javascript:;" th:text="${session.admin.adminName}"></a>
            <dl class="layui-nav-child">
                <!-- 二级菜单 -->
                <!--<dd>-->
                <!--<a onclick="WeAdminShow('个人信息','http://www.baidu.com')">个人信息</a>-->
                <!--</dd>-->
                <dd>
                    <a class="loginout" href="javascript:void(0);" id="logOut">退出</a>
                </dd>
            </dl>
        </li>
        <li class="layui-nav-item to-index">
            <a target="_blank" href="/home/index/index">前台首页</a>
        </li>
    </ul>
</div>
<!-- 顶部结束 -->

<!-- 中部开始 -->
<!-- 左侧菜单开始 -->
<div th:replace="admin/public/left-menu::left-menu"></div>
<!-- 左侧菜单结束 -->

<!-- 右侧主体开始 -->
<div class="page-content">
    <div class="layui-tab tab" lay-filter="wenav_tab" id="WeTabTip" lay-allowclose="true">
        <ul class="layui-tab-title" id="tabName">
            <li>我的桌面</li>
        </ul>
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <iframe src='/admin/index/welcome' frameborder="0" scrolling="yes" class="weIframe"></iframe>
            </div>
        </div>
    </div>
</div>
<div class="page-content-bg"></div>
<!-- 右侧主体结束 -->
<!-- 中部结束 -->

<!-- 底部开始 -->
<footer class="footer" th:replace="admin/public/footer::footer"></footer>
<!-- 底部结束 -->

<script type="text/javascript">
    layui.config({
        base: '/admin/js/'
        , version: '101100'
    }).use('admin');
    var layer;
    layui.use(['jquery', 'admin', 'layer'], function () {
        var $ = layui.jquery;
        layer = layui.layer;
    });

    /**
     * 退出登录
     */
    $('#logOut').on('click', function () {
        layer.confirm('确要定退出登录吗？', {
            title: '系统提示',
            btn: ['确定', '取消']
        }, function () {
            $.post("/admin/admin/logOut", function (res) {
                if (res.success) {
                    layer.msg(res.errMsg, {icon: 1, time: 1500});
                    setTimeout(goTo("/admin/index/index"), 1500);
                    return;
                }
                layer.msg(res.errMsg, {icon: 2, time: 1500});
            })
        });
    });
</script>
</body>
<!--Tab菜单右键弹出菜单-->
<ul class="rightMenu" id="rightMenu">
    <li data-type="fresh">刷新</li>
    <li data-type="current">关闭当前</li>
    <li data-type="other">关闭其它</li>
    <li data-type="all">关闭所有</li>
</ul>

</html>